/**
 * Created by lenovo on 2018-07-18.
 */
//操作组的颜色设置
var iArr = $(".table-list>table>tbody>tr>td:nth-last-child(1)").find("i");
var len = $(iArr).length;
for(var i=0;i<len;i++){
    var text = $(iArr[i]).text();
    if(text=="取"){
        $(iArr[i]).css("background","#14C1D7");
    }else if(text=="送"){
        $(iArr[i]).css("background","#FDC768");
    }else if(text=="回"){
        $(iArr[i]).css("background","#6852B3");
    }else if(text=="待"){
        $(iArr[i]).css("background","#EF5644");
    }else{
        $(iArr[i]).css("background","#32C966");
    }
}

//展示的时候对应状态取对应的颜色
var iArr2 = $(".table-list>table>tbody>tr>td:nth-last-child(4)>i");
var len2 = $(iArr2).length;
for(var j=0;j<len2;j++){
    var text2 = $(iArr2[j]).text();
    if(text2=="已取衣"){
        $(iArr2[j]).css({"background":"#14C1D7","color":"#fff"});
    }else if(text2=="正在送洗"){
        $(iArr2[j]).css({"background":"#FDC768","color":"#fff"});
    }else if(text2=="已取回"){
        $(iArr2[j]).css({"background":"#6852B3","color":"#fff"});
    }else if(text2=="等待取衣"){
        $(iArr2[j]).css({"background":"#EF5644","color":"#fff"});
    }else{
        $(iArr2[j]).css({"background":"#32C966","color":"#fff"});
    }
}

/*i标签修改处理状态*/
function updateCircle(btnCircle){
    var color = $(btnCircle).css("backgroundColor");
    var aimObj = $(btnCircle).parent().prev().prev().prev().find("i");
    var aim = $(aimObj).css("background",color);
    var text = $(btnCircle).text();
    if(text=="取"){
        $(aimObj).text("已取衣");
    }else if(text=="送"){
        $(aimObj).text("正在送洗");
    }else if(text=="回"){
        $(aimObj).text("已取回");
    }else if(text=="待"){
        $(aimObj).text("等待取衣");
    }else{
        $(aimObj).text("已接受");
    }
};
